package com.example.hbase_server;

import com.example.hbase_server.service.Func;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;


@SpringBootApplication
public class HbaseServerApplication {

    @Autowired
    Func func;

    public static void main(String[] args) {
        SpringApplication.run(HbaseServerApplication.class, args);
    }

    @Component
    public class RunScript {
        @PostConstruct
        public void start() throws Exception {
            func.init();
        }

        @PreDestroy
        public void end(){
            func.close();
        }
    }
}
